package org.htmlparser.parserapplications.filterbuilder;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FileDialog;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetContext;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.beans.PropertyVetoException;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Vector;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JSplitPane;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.JToolBar.Separator;
import javax.swing.JTree;
import javax.swing.KeyStroke;
import org.htmlparser.Parser;
import org.htmlparser.beans.FilterBean;
import org.htmlparser.parserapplications.filterbuilder.layouts.NullLayoutManager;
import org.htmlparser.util.ParserException;

public class FilterBuilder extends JFrame
  implements WindowListener, ActionListener, MouseListener, MouseMotionListener, DragGestureListener, DragSourceListener, DropTargetListener, ClipboardOwner
{
  static final String TITLE = "HTML Parser FilterBuilder";
  static final URL mDocumentBase;
  static String mHomeDir;
  protected Point mBasePoint;
  protected Component mCurrentComponent;
  protected DragSource mDragSource;
  protected DropTarget mDropTarget;
  protected JPanel mMainPanel;
  protected JScrollPane mMainScroller;
  protected boolean mMoved;
  protected JDesktopPane mOutput;
  protected Vector mSelection;
  protected JTextField mURLField;

  static
  {
    String str = System.getProperty("user.dir");
    try
    {
      char c = System.getProperty("file.separator").charAt(0);
      if ('/' != c)
        str.replace(c, '/');
    }
    catch (StringIndexOutOfBoundsException localStringIndexOutOfBoundsException)
    {
      URL localURL;
      File localFile;
      try
      {
        localURL = new URL("file:///" + str + "/");
        mDocumentBase = localURL;
        localFile = new File(System.getProperty("user.home") + System.getProperty("file.separator") + ".htmlparser");
        if ((!(localFile.exists())) && (!(localFile.mkdirs())))
          throw new RuntimeException("cannot create directory " + localFile.getAbsolutePath());
      }
      catch (MalformedURLException localMalformedURLException)
      {
        while (true)
          localURL = null;
        mHomeDir = localFile.getAbsolutePath();
        return;
        localStringIndexOutOfBoundsException = localStringIndexOutOfBoundsException;
      }
    }
  }

  public FilterBuilder()
  {
    this.mMainPanel = new JPanel();
    DropTarget localDropTarget = new DropTarget(this.mMainPanel, this);
    this.mDropTarget = localDropTarget;
    this.mDragSource = new DragSource();
    JMenuBar localJMenuBar = new JMenuBar();
    JToolBar localJToolBar = new JToolBar();
    localJToolBar.setAlignmentY(0.22222200036048889F);
    JMenu localJMenu1 = new JMenu();
    localJMenu1.setText("File");
    localJMenu1.setActionCommand("File");
    localJMenu1.setMnemonic(70);
    makeMenuButton("New", "Create a new document", "New", 78, KeyStroke.getKeyStroke(78, 2), localJToolBar, localJMenu1);
    makeMenuButton("Open", "Open an existing document", "Open...", 79, KeyStroke.getKeyStroke(79, 2), localJToolBar, localJMenu1);
    makeMenuButton("Save", "Save the active document", "Save...", 83, KeyStroke.getKeyStroke(83, 2), localJToolBar, localJMenu1);
    makeMenuButton("SaveAs", "Save the active document", "Save As...", 65, KeyStroke.getKeyStroke(65, 2), null, localJMenu1);
    localJMenu1.add(new JSeparator());
    makeMenuButton("Exit", "Exit the program", "Exit", 69, KeyStroke.getKeyStroke(69, 2), null, localJMenu1);
    localJMenuBar.add(localJMenu1);
    localJToolBar.add(new JToolBar.Separator());
    JMenu localJMenu2 = new JMenu();
    localJMenu2.setText("Edit");
    localJMenu2.setActionCommand("Edit");
    localJMenu2.setMnemonic(69);
    makeMenuButton("Cut", "Cut the selection and put it on the Clipboard", "Cut", 84, KeyStroke.getKeyStroke(88, 2), localJToolBar, localJMenu2);
    makeMenuButton("Copy", "Copy the selection and put it on the Clipboard", "Copy", 67, KeyStroke.getKeyStroke(67, 2), localJToolBar, localJMenu2);
    makeMenuButton("Paste", "Insert Clipboard contents", "Paste", 80, KeyStroke.getKeyStroke(86, 2), localJToolBar, localJMenu2);
    makeMenuButton("Delete", "Delete the selection", "Delete", 68, KeyStroke.getKeyStroke(127, 0), localJToolBar, localJMenu2);
    localJMenuBar.add(localJMenu2);
    JMenu localJMenu3 = new JMenu();
    localJMenu3.setText("Filter");
    localJMenu3.setActionCommand("Filter");
    localJMenu3.setMnemonic(70);
    localJMenuBar.add(localJMenu3);
    localJToolBar.add(new JToolBar.Separator());
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.AndFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.OrFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.NotFilterWrapper");
    localJMenu3.addSeparator();
    localJToolBar.add(new JToolBar.Separator());
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.StringFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.RegexFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.TagNameFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.NodeClassFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.HasAttributeFilterWrapper");
    localJMenu3.addSeparator();
    localJToolBar.add(new JToolBar.Separator());
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.HasParentFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.HasChildFilterWrapper");
    addFilter(localJMenu3, localJToolBar, "org.htmlparser.parserapplications.filterbuilder.wrappers.HasSiblingFilterWrapper");
    localJMenu3.addSeparator();
    localJToolBar.add(new JToolBar.Separator());
    JMenu localJMenu4 = new JMenu();
    localJMenu4.setText("Operation");
    localJMenu4.setActionCommand("Operation");
    localJMenu4.setMnemonic(114);
    JMenuItem localJMenuItem1 = new JMenuItem();
    localJMenuItem1.setText("Expand");
    localJMenuItem1.setActionCommand("expandAction");
    localJMenuItem1.addActionListener(this);
    localJMenu4.add(localJMenuItem1);
    JMenuItem localJMenuItem2 = new JMenuItem();
    localJMenuItem2.setText("Collapse");
    localJMenuItem2.setActionCommand("collapseAction");
    localJMenuItem2.addActionListener(this);
    localJMenu4.add(localJMenuItem2);
    localJMenu4.addSeparator();
    JMenuItem localJMenuItem3 = new JMenuItem();
    localJMenuItem3.setText("Expand All");
    localJMenuItem3.setActionCommand("expandAllAction");
    localJMenuItem3.addActionListener(this);
    localJMenu4.add(localJMenuItem3);
    JMenuItem localJMenuItem4 = new JMenuItem();
    localJMenuItem4.setText("Collapse All");
    localJMenuItem4.setActionCommand("collapseAllAction");
    localJMenuItem4.addActionListener(this);
    localJMenu4.add(localJMenuItem4);
    localJMenu4.addSeparator();
    JMenuItem localJMenuItem5 = new JMenuItem("Fetch Page");
    localJMenuItem5.setActionCommand("fetchAction");
    localJMenuItem5.addActionListener(this);
    localJMenu4.add(localJMenuItem5);
    JMenuItem localJMenuItem6 = new JMenuItem("Execute Filter");
    localJMenuItem6.setActionCommand("executeAction");
    localJMenuItem6.addActionListener(this);
    localJMenu4.add(localJMenuItem6);
    localJMenuBar.add(localJMenu4);
    JMenu localJMenu5 = new JMenu();
    localJMenu5.setText("Help");
    localJMenu5.setActionCommand("Help");
    localJMenu5.setMnemonic(72);
    JMenuItem localJMenuItem7 = new JMenuItem("Filtering");
    localJMenuItem7.setActionCommand("filteringAction");
    localJMenuItem7.addActionListener(this);
    localJMenu5.add(localJMenuItem7);
    JMenuItem localJMenuItem8 = new JMenuItem("Instructions");
    localJMenuItem8.setActionCommand("instructionsAction");
    localJMenuItem8.addActionListener(this);
    localJMenu5.add(localJMenuItem8);
    JMenuItem localJMenuItem9 = new JMenuItem("Tutorial");
    localJMenuItem9.setActionCommand("tutorialAction");
    localJMenuItem9.addActionListener(this);
    localJMenu5.add(localJMenuItem9);
    JMenuItem localJMenuItem10 = new JMenuItem("Hints");
    localJMenuItem10.setActionCommand("hintsAction");
    localJMenuItem10.addActionListener(this);
    localJMenu5.add(localJMenuItem10);
    makeMenuButton("About", "Display program information, version number and copyright", "About", 66, KeyStroke.getKeyStroke(72, 2), localJToolBar, localJMenu5);
    localJMenuBar.add(localJMenu5);
    setJMenuBar(localJMenuBar);
    JPanel localJPanel = new JPanel();
    localJPanel.setLayout(new FlowLayout(0, 0, 0));
    localJPanel.add(localJToolBar);
    getContentPane().setLayout(new BorderLayout(0, 0));
    getContentPane().add("North", localJPanel);
    this.mURLField = new JTextField();
    this.mURLField.setToolTipText("Enter the URL to view");
    this.mURLField.setText("http://sourceforge.org/projects/htmlparser");
    getContentPane().add("South", this.mURLField);
    setTitle("HTML Parser FilterBuilder");
    setDefaultCloseOperation(0);
    setSize(640, 480);
    setVisible(false);
    this.mMainPanel.setLayout(new NullLayoutManager());
    this.mMainScroller = new JScrollPane(this.mMainPanel, 20, 30);
    JSplitPane localJSplitPane = new JSplitPane();
    JScrollPane localJScrollPane = new JScrollPane();
    localJScrollPane.setViewportView(this.mMainScroller);
    localJSplitPane.setLeftComponent(localJScrollPane);
    this.mOutput = new JDesktopPane();
    localJSplitPane.setRightComponent(this.mOutput);
    getContentPane().add("Center", localJSplitPane);
    setVisible(true);
    localJSplitPane.setDividerLocation(0.5D);
    setVisible(false);
    addWindowListener(this);
    setIconImage(Toolkit.getDefaultToolkit().getImage("images/program16.gif"));
    addMouseListener(this);
    addMouseMotionListener(this);
    this.mSelection = new Vector();
  }

  public FilterBuilder(String paramString)
  {
    setTitle(paramString);
  }

  public static void main(String[] paramArrayOfString)
  {
    FilterBuilder localFilterBuilder;
    try
    {
      localFilterBuilder = new FilterBuilder();
      if (paramArrayOfString.length != 0)
        localFilterBuilder.mURLField.setText(paramArrayOfString[0]);
      localFilterBuilder.setVisible(true);
      return;
    }
    catch (Throwable localThrowable)
    {
      localThrowable.printStackTrace();
      System.exit(1);
    }
  }

  protected void aboutAction()
  {
    JPanel localJPanel = this.mMainPanel;
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "Close";
    JOptionPane.showOptionDialog(localJPanel, "<html><center><font color=black>The HTML Parser <font color=blue><b>FilterBuilder</b></font><br><i>by Derrick Oswald</i>&nbsp;&nbsp;<b>DerrickOswald@users.sourceforge.net</b><br>http://htmlparser.org<br><br><font size=-2>Copyright &copy; 2005</font></center></html>", "About FilterBuilder", -1, 1, null, arrayOfString, "Close");
  }

  public void actionPerformed(ActionEvent paramActionEvent)
  {
    String str;
    Object localObject = paramActionEvent.getSource();
    if (localObject instanceof JButton)
    {
      str = ((JButton)localObject).getActionCommand();
      if (localObject instanceof Component)
        this.mCurrentComponent = ((Component)localObject);
      if (str != null);
    }
    try
    {
      while (true)
      {
        getClass().getDeclaredMethod(str, new Class[0]).invoke(this, new Object[0]);
        return;
        if (!(localObject instanceof JMenuItem))
          break;
        str = ((JMenuItem)localObject).getActionCommand();
      }
      str = null;
    }
    catch (NoSuchMethodException localNoSuchMethodException)
    {
      while (true)
        System.out.println("no " + str + " method found");
    }
    catch (Exception localException)
    {
      while (true)
        localException.printStackTrace();
    }
  }

  public void addFilter(JMenu paramJMenu, JToolBar paramJToolBar, String paramString)
  {
    Filter localFilter = Filter.instantiate(paramString);
    if (localFilter != null)
    {
      String str1 = localFilter.getNodeFilter().getClass().getName();
      String str2 = localFilter.getDescription();
      Icon localIcon = localFilter.getIcon();
      String str3 = str1.substring(1 + str1.lastIndexOf(46));
      JMenuItem localJMenuItem = new JMenuItem();
      localJMenuItem.setName(paramString);
      localJMenuItem.setText(str3);
      localJMenuItem.setActionCommand("filterAction");
      localJMenuItem.setToolTipText(str2);
      localJMenuItem.setIcon(localIcon);
      localJMenuItem.addActionListener(this);
      paramJMenu.add(localJMenuItem);
      paramJToolBar.add(makeFilterButton(paramString));
    }
  }

  protected void addSelection(Filter paramFilter)
  {
    if (!(selectionContains(paramFilter)))
      this.mSelection.addElement(paramFilter);
    paramFilter.setSelected(true);
    this.mMoved = false;
  }

  protected String classFromFile(String paramString)
  {
    String str = System.getProperty("file.separator");
    int i = paramString.lastIndexOf(str);
    if (-1 != i)
      paramString = paramString.substring(i + str.length());
    int j = paramString.indexOf(46);
    if (-1 != j)
      paramString = paramString.substring(0, j);
    return paramString;
  }

  protected void clearSelection()
  {
    selectSelection(false);
    this.mSelection.removeAllElements();
  }

  public void collapseAction()
  {
    setExpanded(getSelection(), false, false);
  }

  public void collapseAllAction()
  {
    setExpanded(getSelection(), false, true);
  }

  protected void copyAction()
  {
    StringSelection localStringSelection = new StringSelection(serializeSelection());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(localStringSelection, this);
  }

  protected void cutAction()
  {
    StringSelection localStringSelection = new StringSelection(serializeSelection());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(localStringSelection, this);
    deleteSelection();
    relayout();
  }

  protected void deleteAction()
  {
    deleteSelection();
    relayout();
  }

  public void deleteSelection()
  {
    Filter[] arrayOfFilter = getSelection();
    int i = 0;
    if (i < arrayOfFilter.length)
    {
      SubFilterList localSubFilterList = getEnclosing(arrayOfFilter[i]);
      if (localSubFilterList != null)
        localSubFilterList.removeFilter(arrayOfFilter[i]);
      while (true)
      {
        while (true)
          ++i;
        this.mMainPanel.remove(arrayOfFilter[i]);
      }
    }
    this.mSelection.clear();
  }

  public void dragDropEnd(DragSourceDropEvent paramDragSourceDropEvent)
  {
    if (paramDragSourceDropEvent.getDropSuccess());
  }

  public void dragEnter(DragSourceDragEvent paramDragSourceDragEvent)
  {
  }

  public void dragEnter(DropTargetDragEvent paramDropTargetDragEvent)
  {
    SubFilterList localSubFilterList;
    for (Object localObject = paramDropTargetDragEvent.getDropTargetContext().getComponent(); (localObject != null) && (!(localObject instanceof SubFilterList)) && (localObject != this.mMainPanel); localObject = ((Component)localObject).getParent());
    if (localObject instanceof SubFilterList)
    {
      localSubFilterList = (SubFilterList)localObject;
      if (localSubFilterList != null)
      {
        if (localSubFilterList.canAccept())
          break label68;
        paramDropTargetDragEvent.rejectDrag();
      }
    }
    while (true)
    {
      while (true)
      {
        return;
        localSubFilterList = null;
      }
      label68: localSubFilterList.setSelected(true);
    }
  }

  public void dragExit(DragSourceEvent paramDragSourceEvent)
  {
  }

  public void dragExit(DropTargetEvent paramDropTargetEvent)
  {
    SubFilterList localSubFilterList;
    for (Object localObject = paramDropTargetEvent.getDropTargetContext().getComponent(); (localObject != null) && (!(localObject instanceof SubFilterList)) && (localObject != this.mMainPanel); localObject = ((Component)localObject).getParent());
    if (localObject instanceof SubFilterList)
      localSubFilterList = (SubFilterList)localObject;
    while (true)
    {
      if (localSubFilterList != null)
        localSubFilterList.setSelected(false);
      return;
      localSubFilterList = null;
    }
  }

  public void dragGestureRecognized(DragGestureEvent paramDragGestureEvent)
  {
    Component localComponent = paramDragGestureEvent.getComponent();
    try
    {
      String str = localComponent.getName();
      if (str != null)
      {
        Filter localFilter = Filter.instantiate(str);
        Filter[] arrayOfFilter = new Filter[1];
        arrayOfFilter[0] = localFilter;
        StringSelection localStringSelection = new StringSelection(Filter.deconstitute(arrayOfFilter));
        this.mDragSource.startDrag(paramDragGestureEvent, DragSource.DefaultMoveDrop, localStringSelection, this);
      }
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public void dragOver(DragSourceDragEvent paramDragSourceDragEvent)
  {
  }

  public void dragOver(DropTargetDragEvent paramDropTargetDragEvent)
  {
  }

  // ERROR //
  public void drop(java.awt.dnd.DropTargetDropEvent paramDropTargetDropEvent)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokevirtual 722	java/awt/dnd/DropTargetDropEvent:getDropTargetContext	()Ljava/awt/dnd/DropTargetContext;
    //   4: astore_2
    //   5: aload_2
    //   6: invokevirtual 678	java/awt/dnd/DropTargetContext:getComponent	()Ljava/awt/Component;
    //   9: astore_3
    //   10: aload_3
    //   11: ifnull +26 -> 37
    //   14: aload_3
    //   15: instanceof 647
    //   18: ifne +19 -> 37
    //   21: aload_3
    //   22: aload_0
    //   23: getfield 127	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mMainPanel	Ljavax/swing/JPanel;
    //   26: if_acmpeq +11 -> 37
    //   29: aload_3
    //   30: invokevirtual 681	java/awt/Component:getParent	()Ljava/awt/Container;
    //   33: astore_3
    //   34: goto -24 -> 10
    //   37: aload_3
    //   38: instanceof 647
    //   41: ifeq +213 -> 254
    //   44: aload_3
    //   45: checkcast 647	org/htmlparser/parserapplications/filterbuilder/SubFilterList
    //   48: astore 4
    //   50: aload_1
    //   51: invokevirtual 726	java/awt/dnd/DropTargetDropEvent:getTransferable	()Ljava/awt/datatransfer/Transferable;
    //   54: astore 7
    //   56: aload 7
    //   58: getstatic 732	java/awt/datatransfer/DataFlavor:stringFlavor	Ljava/awt/datatransfer/DataFlavor;
    //   61: invokeinterface 738 2 0
    //   66: ifeq +139 -> 205
    //   69: aload_1
    //   70: iconst_2
    //   71: invokevirtual 741	java/awt/dnd/DropTargetDropEvent:acceptDrop	(I)V
    //   74: aload 7
    //   76: getstatic 732	java/awt/datatransfer/DataFlavor:stringFlavor	Ljava/awt/datatransfer/DataFlavor;
    //   79: invokeinterface 745 2 0
    //   84: checkcast 65	java/lang/String
    //   87: astore 8
    //   89: aload_1
    //   90: invokevirtual 749	java/awt/dnd/DropTargetDropEvent:getLocation	()Ljava/awt/Point;
    //   93: astore 9
    //   95: aload 8
    //   97: new 751	org/htmlparser/Parser
    //   100: dup
    //   101: aload_0
    //   102: getfield 359	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mURLField	Ljavax/swing/JTextField;
    //   105: invokevirtual 754	javax/swing/JTextField:getText	()Ljava/lang/String;
    //   108: invokespecial 755	org/htmlparser/Parser:<init>	(Ljava/lang/String;)V
    //   111: invokestatic 759	org/htmlparser/parserapplications/filterbuilder/Filter:reconstitute	(Ljava/lang/String;Lorg/htmlparser/Parser;)[Lorg/htmlparser/parserapplications/filterbuilder/Filter;
    //   114: astore 11
    //   116: aload 11
    //   118: arraylength
    //   119: ifle +13 -> 132
    //   122: aload_0
    //   123: aload 11
    //   125: aload 9
    //   127: aload 4
    //   129: invokevirtual 763	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:insertFilters	([Lorg/htmlparser/parserapplications/filterbuilder/Filter;Ljava/awt/Point;Lorg/htmlparser/parserapplications/filterbuilder/SubFilterList;)V
    //   132: aload 4
    //   134: ifnull +9 -> 143
    //   137: aload 4
    //   139: iconst_0
    //   140: invokevirtual 688	org/htmlparser/parserapplications/filterbuilder/SubFilterList:setSelected	(Z)V
    //   143: aload_2
    //   144: iconst_1
    //   145: invokevirtual 766	java/awt/dnd/DropTargetContext:dropComplete	(Z)V
    //   148: goto +105 -> 253
    //   151: astore 10
    //   153: aload 10
    //   155: invokevirtual 530	java/lang/Exception:printStackTrace	()V
    //   158: goto -15 -> 143
    //   161: astore 6
    //   163: aload 6
    //   165: invokevirtual 767	java/io/IOException:printStackTrace	()V
    //   168: getstatic 770	java/lang/System:err	Ljava/io/PrintStream;
    //   171: new 77	java/lang/StringBuffer
    //   174: dup
    //   175: invokespecial 80	java/lang/StringBuffer:<init>	()V
    //   178: ldc_w 772
    //   181: invokevirtual 86	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   184: aload 6
    //   186: invokevirtual 775	java/io/IOException:getMessage	()Ljava/lang/String;
    //   189: invokevirtual 86	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   192: invokevirtual 92	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   195: invokevirtual 529	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   198: aload_1
    //   199: invokevirtual 778	java/awt/dnd/DropTargetDropEvent:rejectDrop	()V
    //   202: goto +51 -> 253
    //   205: aload_1
    //   206: invokevirtual 778	java/awt/dnd/DropTargetDropEvent:rejectDrop	()V
    //   209: goto +44 -> 253
    //   212: astore 5
    //   214: aload 5
    //   216: invokevirtual 779	java/awt/datatransfer/UnsupportedFlavorException:printStackTrace	()V
    //   219: getstatic 770	java/lang/System:err	Ljava/io/PrintStream;
    //   222: new 77	java/lang/StringBuffer
    //   225: dup
    //   226: invokespecial 80	java/lang/StringBuffer:<init>	()V
    //   229: ldc_w 772
    //   232: invokevirtual 86	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   235: aload 5
    //   237: invokevirtual 780	java/awt/datatransfer/UnsupportedFlavorException:getMessage	()Ljava/lang/String;
    //   240: invokevirtual 86	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   243: invokevirtual 92	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   246: invokevirtual 529	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   249: aload_1
    //   250: invokevirtual 778	java/awt/dnd/DropTargetDropEvent:rejectDrop	()V
    //   253: return
    //   254: aconst_null
    //   255: astore 4
    //   257: goto -207 -> 50
    //
    // Exception table:
    //   from	to	target	type
    //   95	143	151	java/lang/Exception
    //   50	95	161	java/io/IOException
    //   95	143	161	java/io/IOException
    //   143	158	161	java/io/IOException
    //   205	209	161	java/io/IOException
    //   50	95	212	java/awt/datatransfer/UnsupportedFlavorException
    //   95	143	212	java/awt/datatransfer/UnsupportedFlavorException
    //   143	158	212	java/awt/datatransfer/UnsupportedFlavorException
    //   205	209	212	java/awt/datatransfer/UnsupportedFlavorException
  }

  public void dropActionChanged(DragSourceDragEvent paramDragSourceDragEvent)
  {
  }

  public void dropActionChanged(DropTargetDragEvent paramDropTargetDragEvent)
  {
  }

  protected void executeAction()
  {
    JInternalFrame localJInternalFrame;
    Filter[] arrayOfFilter = getSelection();
    if (arrayOfFilter.length == 0)
      arrayOfFilter = getFilters();
    if (arrayOfFilter.length != 0)
    {
      FilterBean localFilterBean = new FilterBean();
      localFilterBean.setURL(this.mURLField.getText());
      localFilterBean.setFilters(arrayOfFilter);
      localJInternalFrame = new JInternalFrame(localFilterBean.getURL());
      localJInternalFrame.setClosable(true);
      localJInternalFrame.setResizable(true);
      Dimension localDimension = this.mOutput.getSize();
      localJInternalFrame.setBounds(0, 0, localDimension.width, localDimension.height / 2);
      JTree localJTree = new JTree(new HtmlTreeModel(localFilterBean.getNodes()));
      localJTree.setRootVisible(false);
      localJTree.setCellRenderer(new HtmlTreeCellRenderer());
      localJInternalFrame.setContentPane(new JScrollPane(new JScrollPane(localJTree), 20, 30));
      this.mOutput.add(localJInternalFrame, new Integer(2));
    }
    try
    {
      localJInternalFrame.setSelected(true);
      localJInternalFrame.show();
      return;
    }
    catch (PropertyVetoException localPropertyVetoException)
    {
      localPropertyVetoException.printStackTrace();
    }
  }

  protected void exitAction()
  {
    exitApplication();
  }

  void exitApplication()
  {
    setVisible(false);
    dispose();
    System.exit(0);
  }

  public void expandAction()
  {
    setExpanded(getSelection(), true, false);
  }

  public void expandAllAction()
  {
    setExpanded(getSelection(), true, true);
  }

  // ERROR //
  protected void fetchAction()
  {
    // Byte code:
    //   0: new 798	javax/swing/JInternalFrame
    //   3: dup
    //   4: aload_0
    //   5: getfield 359	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mURLField	Ljavax/swing/JTextField;
    //   8: invokevirtual 754	javax/swing/JTextField:getText	()Ljava/lang/String;
    //   11: invokespecial 802	javax/swing/JInternalFrame:<init>	(Ljava/lang/String;)V
    //   14: astore_1
    //   15: aload_1
    //   16: iconst_1
    //   17: invokevirtual 805	javax/swing/JInternalFrame:setClosable	(Z)V
    //   20: aload_1
    //   21: iconst_1
    //   22: invokevirtual 808	javax/swing/JInternalFrame:setResizable	(Z)V
    //   25: aload_0
    //   26: getfield 408	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mOutput	Ljavax/swing/JDesktopPane;
    //   29: invokevirtual 812	javax/swing/JDesktopPane:getSize	()Ljava/awt/Dimension;
    //   32: astore_2
    //   33: aload_1
    //   34: iconst_0
    //   35: iconst_0
    //   36: aload_2
    //   37: getfield 818	java/awt/Dimension:width	I
    //   40: aload_2
    //   41: getfield 821	java/awt/Dimension:height	I
    //   44: invokevirtual 825	javax/swing/JInternalFrame:setBounds	(IIII)V
    //   47: new 880	org/htmlparser/util/NodeList
    //   50: dup
    //   51: invokespecial 881	org/htmlparser/util/NodeList:<init>	()V
    //   54: astore_3
    //   55: new 751	org/htmlparser/Parser
    //   58: dup
    //   59: aload_0
    //   60: getfield 359	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mURLField	Ljavax/swing/JTextField;
    //   63: invokevirtual 754	javax/swing/JTextField:getText	()Ljava/lang/String;
    //   66: invokespecial 755	org/htmlparser/Parser:<init>	(Ljava/lang/String;)V
    //   69: astore 4
    //   71: aload 4
    //   73: invokevirtual 885	org/htmlparser/Parser:elements	()Lorg/htmlparser/util/NodeIterator;
    //   76: astore 10
    //   78: aload 10
    //   80: invokeinterface 890 1 0
    //   85: ifeq +66 -> 151
    //   88: aload_3
    //   89: aload 10
    //   91: invokeinterface 894 1 0
    //   96: invokevirtual 897	org/htmlparser/util/NodeList:add	(Lorg/htmlparser/Node;)V
    //   99: goto -21 -> 78
    //   102: astore 8
    //   104: aload_3
    //   105: invokevirtual 900	org/htmlparser/util/NodeList:removeAll	()V
    //   108: aload 4
    //   110: invokevirtual 903	org/htmlparser/Parser:reset	()V
    //   113: aload 4
    //   115: invokevirtual 885	org/htmlparser/Parser:elements	()Lorg/htmlparser/util/NodeIterator;
    //   118: astore 9
    //   120: aload 9
    //   122: invokeinterface 890 1 0
    //   127: ifeq +24 -> 151
    //   130: aload_3
    //   131: aload 9
    //   133: invokeinterface 894 1 0
    //   138: invokevirtual 897	org/htmlparser/util/NodeList:add	(Lorg/htmlparser/Node;)V
    //   141: goto -21 -> 120
    //   144: astore 5
    //   146: aload 5
    //   148: invokevirtual 904	org/htmlparser/util/ParserException:printStackTrace	()V
    //   151: new 827	javax/swing/JTree
    //   154: dup
    //   155: new 829	org/htmlparser/parserapplications/filterbuilder/HtmlTreeModel
    //   158: dup
    //   159: aload_3
    //   160: invokespecial 836	org/htmlparser/parserapplications/filterbuilder/HtmlTreeModel:<init>	(Lorg/htmlparser/util/NodeList;)V
    //   163: invokespecial 839	javax/swing/JTree:<init>	(Ljavax/swing/tree/TreeModel;)V
    //   166: astore 6
    //   168: aload 6
    //   170: iconst_0
    //   171: invokevirtual 842	javax/swing/JTree:setRootVisible	(Z)V
    //   174: aload 6
    //   176: new 844	org/htmlparser/parserapplications/filterbuilder/HtmlTreeCellRenderer
    //   179: dup
    //   180: invokespecial 845	org/htmlparser/parserapplications/filterbuilder/HtmlTreeCellRenderer:<init>	()V
    //   183: invokevirtual 849	javax/swing/JTree:setCellRenderer	(Ljavax/swing/tree/TreeCellRenderer;)V
    //   186: aload_1
    //   187: new 387	javax/swing/JScrollPane
    //   190: dup
    //   191: new 387	javax/swing/JScrollPane
    //   194: dup
    //   195: aload 6
    //   197: invokespecial 851	javax/swing/JScrollPane:<init>	(Ljava/awt/Component;)V
    //   200: bipush 20
    //   202: bipush 30
    //   204: invokespecial 390	javax/swing/JScrollPane:<init>	(Ljava/awt/Component;II)V
    //   207: invokevirtual 855	javax/swing/JInternalFrame:setContentPane	(Ljava/awt/Container;)V
    //   210: aload_0
    //   211: getfield 408	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mOutput	Ljavax/swing/JDesktopPane;
    //   214: aload_1
    //   215: new 857	java/lang/Integer
    //   218: dup
    //   219: iconst_1
    //   220: invokespecial 859	java/lang/Integer:<init>	(I)V
    //   223: invokevirtual 862	javax/swing/JDesktopPane:add	(Ljava/awt/Component;Ljava/lang/Object;)V
    //   226: aload_1
    //   227: iconst_1
    //   228: invokevirtual 863	javax/swing/JInternalFrame:setSelected	(Z)V
    //   231: aload_1
    //   232: invokevirtual 866	javax/swing/JInternalFrame:show	()V
    //   235: return
    //   236: astore 7
    //   238: aload 7
    //   240: invokevirtual 867	java/beans/PropertyVetoException:printStackTrace	()V
    //   243: goto -12 -> 231
    //
    // Exception table:
    //   from	to	target	type
    //   71	99	102	org/htmlparser/util/EncodingChangeException
    //   55	71	144	org/htmlparser/util/ParserException
    //   71	99	144	org/htmlparser/util/ParserException
    //   104	141	144	org/htmlparser/util/ParserException
    //   226	231	236	java/beans/PropertyVetoException
  }

  protected void filterAction()
  {
    Object localObject = Filter.instantiate(this.mCurrentComponent.getName());
    try
    {
      Filter localFilter = Filter.wrap(((Filter)localObject).getNodeFilter(), new Parser(this.mURLField.getText()));
      localObject = localFilter;
      if (isSingleSelection())
      {
        SubFilterList localSubFilterList = getEnclosed(getSelection()[0]);
        if (localSubFilterList != null)
        {
          Filter[] arrayOfFilter2 = new Filter[1];
          arrayOfFilter2[0] = localObject;
          insertFilters(arrayOfFilter2, null, localSubFilterList);
          return;
        }
      }
    }
    catch (ParserException localParserException)
    {
      while (true)
        localParserException.printStackTrace();
      Point localPoint = new Point(50, 50);
      Filter[] arrayOfFilter1 = new Filter[1];
      arrayOfFilter1[0] = localObject;
      insertFilters(arrayOfFilter1, localPoint, null);
    }
  }

  protected void filteringAction()
  {
    JPanel localJPanel = this.mMainPanel;
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "Close";
    JOptionPane.showOptionDialog(localJPanel, "<html>The HTML Parser filter subsystem extracts items from a web page,<br>corresponding to the use-case 'I want this little piece of information from http://yadda'.<br>The web page is considered a heirarchical tree of nodes. Usually the root node is &lt;html&gt;,<br>intermediate level nodes are &lt;div&gt; and &lt;table&gt; for example,<br>and leaf nodes are things like text or &lt;img&gt;.<br>Any node that isn't the root node has a 'parent' node.<br>Leaf nodes, by definition, have no 'children'.<br>A filter is a Java class that answers the simple question:<br><pre>Is this node acceptable? True or false.</pre><br>Some filters know the answer just by looking at the node,<br>while others must ask other filters, sometimes looking up or down the node heirarchy.<br><b>The FilterBuilder is a program for making other programs that use filters.</b><br>By combining different types of filters, specific nodes can be isolated from the<br>target web page.<br>The results are usually passed on to another part of the users program<br>that does something useful with them.<br>The filters available include:<br><ul><li>AndFilter - The main 'combining' filter, answers <code>true</code> only if<br>all it's subfilters (predicates) are <code>true</code>.</li><li>OrFilter - A 'combining' filter that answers <code>true</code> if<br>any of it's subfilters (predicates) are <code>true</code>.</li><li>NotFilter - A 'reversing' filter that answers <code>true</code> if<br>it's subfilter (predicate) is <code>false</code>.</li><li>StringFilter - A 'leaf' filter that answers <code>true</code> if<br>the node is text and it contains a certain sequence of characters.<br>It can be made case insensitive, but in this case a 'locale' must be<br>supplied as a context for upper-case conversion.</li><li>RegexFilter - A 'leaf' filter that answers <code>true</code> if<br>the node is text and it contains a certain pattern (regular expression).<br>Regular expressions are descibed in the java.util.regex.Pattern class documentation.</li><li>TagNameFilter - A filter that answers <code>true</code> if<br>the node is a tag and it has a certain name,i.e. &lt;div&gt; would match the name <code>DIV</code>.</li><li>NodeClassFilter - A filter that answers <code>true</code> if<br>the node is a certain tag class. Not recommended, use TagNameFilter instead.</li><li>HasAttributeFilter - A filter that answers <code>true</code> if<br>the node is a tag and it has a certain attribute,<br>i.e. &lt;script language=javascript&gt; would match the attribute <code>LANGUAGE</code>.<br>It can be further restricted to have a certain attribute value as well,<br>i.e. 'javascript' in this example.</li><li>HasParentFilter - A filter that answers <code>true</code> if<br>the node is a child of a node that is acceptable to a certain filter.<br>This can be made recursive, which means the acceptable parent can be<br>further up the heirarchy than just the immediate parent node.</li><li>HasChildFilter - A filter that answers <code>true</code> if<br>the node is a parent of a node that is acceptable to a certain filter.<br>This can be made recursive, which means the acceptable child can be<br>further down the heirarchy than just the immediate children nodes.</li><li>HasSiblingFilter - A filter that answers <code>true</code> if<br>the node is a sibling (they have a common parent) of a node that is<br>acceptable to a certain filter.</li></ul></html>", "FilterBuilder Instructons", -1, 1, null, arrayOfString, "Close");
  }

  protected Point getBasePoint()
  {
    return this.mBasePoint;
  }

  protected SubFilterList getEnclosed(Component paramComponent)
  {
    SubFilterList localSubFilterList;
    int i;
    if (paramComponent instanceof Container)
    {
      Component[] arrayOfComponent = ((Container)paramComponent).getComponents();
      i = 0;
      if (i < arrayOfComponent.length)
        if (arrayOfComponent[i] instanceof SubFilterList)
          localSubFilterList = (SubFilterList)arrayOfComponent[i];
    }
    while (true)
    {
      while (true)
      {
        return localSubFilterList;
        ++i;
      }
      localSubFilterList = null;
    }
  }

  protected SubFilterList getEnclosing(Component paramComponent)
  {
    do
      paramComponent = paramComponent.getParent();
    while ((paramComponent != null) && (!(paramComponent instanceof SubFilterList)));
    return ((SubFilterList)paramComponent);
  }

  public Filter[] getFilters()
  {
    Component[] arrayOfComponent = this.mMainPanel.getComponents();
    Filter[] arrayOfFilter = new Filter[arrayOfComponent.length];
    System.arraycopy(arrayOfComponent, 0, arrayOfFilter, 0, arrayOfComponent.length);
    return arrayOfFilter;
  }

  protected Filter[] getSelection()
  {
    Filter[] arrayOfFilter = new Filter[this.mSelection.size()];
    this.mSelection.copyInto(arrayOfFilter);
    return arrayOfFilter;
  }

  protected URL getURL(String paramString)
    throws MalformedURLException
  {
    URL localURL = getClass().getResource(paramString);
    if (localURL == null)
    {
      if ((mDocumentBase == null) || (-1 != paramString.indexOf("//")))
        break label45;
      localURL = new URL(mDocumentBase, paramString);
    }
    while (true)
    {
      return localURL;
      label45: localURL = new URL(paramString);
    }
  }

  protected void hintsAction()
  {
    JPanel localJPanel = this.mMainPanel;
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "Close";
    JOptionPane.showOptionDialog(localJPanel, "<html>Hints:<br><ul><li>There is no undo yet, so save often.</li><li>Recursive HasParent and HasChild filters can be costly.</li><li>RegexFilter is more expensive than StringFilter.</li><li>The order of predicates in And and Or filters matters for performance,<br>put cheap tests first.</li><li>The same node may show up more than once in the results,<br>and at more than one nesting depth, depending on the filter used.</li><li>Typing in a tag name in the TagName filter is not recommended,<br>since extraneous characters can be added. Use an item from the list instead.</li></ul></html>", "FilterBuilder Hints", -1, 1, null, arrayOfString, "Close");
  }

  protected void insertFilters(Filter[] paramArrayOfFilter, Point paramPoint, SubFilterList paramSubFilterList)
  {
    if (paramSubFilterList == null)
    {
      int j = 0;
      while (true)
      {
        if (j >= paramArrayOfFilter.length)
          break label87;
        paramArrayOfFilter[j].setLocation(paramPoint);
        this.mMainPanel.add(paramArrayOfFilter[j]);
        Dimension localDimension = paramArrayOfFilter[j].getPreferredSize();
        paramPoint.y += localDimension.height;
        ++j;
      }
    }
    for (int i = 0; i < paramArrayOfFilter.length; ++i)
      paramSubFilterList.addFilter(paramArrayOfFilter[i]);
    label87: setupDropTargets(paramArrayOfFilter);
    setupMouseListeners(paramArrayOfFilter);
    relayout();
  }

  protected void instructionsAction()
  {
    JPanel localJPanel = this.mMainPanel;
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "Close";
    JOptionPane.showOptionDialog(localJPanel, "<html>Enter the target URL in the text box at the bottom of the window.<br>Choose 'Fetch Page' from the Operations menu to see the whole page.<br>Pick filters from the Filter menu or drag them from the toolbar.<br>Filters such as And, Or, Not, HasParent, HasChild and HasSibling contain other filters:<br><ul><li>drag new filters into their blank areas at the bottom</li><li>cut an existing filter and paste into a selected filter</li></ul>Build the filter incrementally, choosing 'Execute Filter' to test the selected filter.<br>Save creates a .java file that runs the top level filter.<br>Right click on a filter displays a pop-up menu.<br>Double click on a blue item in the result pane expands the tree.</html>", "FilterBuilder Instructons", -1, 1, null, arrayOfString, "Close");
  }

  public boolean isSingleSelection()
  {
    int i;
    if (1 == this.mSelection.size())
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }

  protected Filter lastSelected()
  {
    Filter localFilter = null;
    if (this.mSelection.size() > 0)
      localFilter = (Filter)this.mSelection.lastElement();
    return localFilter;
  }

  public void lostOwnership(Clipboard paramClipboard, Transferable paramTransferable)
  {
    System.out.println("lost clipboard ownership");
  }

  public JButton makeFilterButton(String paramString)
  {
    JButton localJButton = new JButton();
    Filter localFilter = Filter.instantiate(paramString);
    if (localFilter != null)
    {
      localJButton.setName(paramString);
      localJButton.setToolTipText(localFilter.getDescription());
      localJButton.setMargin(new Insets(0, 0, 0, 0));
      localJButton.setIcon(localFilter.getIcon());
      this.mDragSource.createDefaultDragGestureRecognizer(localJButton, 2, this);
      localJButton.setActionCommand("filterAction");
      localJButton.addActionListener(this);
    }
    return localJButton;
  }

  protected void makeMenuButton(String paramString1, String paramString2, String paramString3, int paramInt, KeyStroke paramKeyStroke, JToolBar paramJToolBar, JMenu paramJMenu)
  {
    ImageIcon localImageIcon;
    String str = paramString1.toLowerCase();
    try
    {
      localImageIcon = new ImageIcon(getURL("images/" + str + ".gif"));
      JMenuItem localJMenuItem = new JMenuItem();
      localJMenuItem.setText(paramString3);
      localJMenuItem.setActionCommand(str + "Action");
      localJMenuItem.setAccelerator(paramKeyStroke);
      localJMenuItem.setMnemonic(paramInt);
      localJMenuItem.setIcon(localImageIcon);
      localJMenuItem.addActionListener(this);
      paramJMenu.add(localJMenuItem);
      if (paramJToolBar != null)
      {
        JButton localJButton = new JButton();
        localJButton.setDefaultCapable(false);
        localJButton.setToolTipText(paramString2);
        localJButton.setMnemonic(paramInt);
        localJButton.setActionCommand(str + "Action");
        localJButton.setMargin(new Insets(0, 0, 0, 0));
        localJButton.setIcon(localImageIcon);
        localJButton.addActionListener(this);
        paramJToolBar.add(localJButton);
      }
      return;
    }
    catch (MalformedURLException localMalformedURLException)
    {
      localImageIcon = null;
    }
  }

  protected void makeProgram(String paramString, StringBuffer paramStringBuffer, FilterBean paramFilterBean)
  {
    String[] arrayOfString;
    Filter[] arrayOfFilter = (Filter[])(Filter[])paramFilterBean.getFilters();
    int[] arrayOfInt = new int[3];
    arrayOfInt[0] = 0;
    Filter.spaces(paramStringBuffer, arrayOfInt[0]);
    paramStringBuffer.append("// Generated by FilterBuilder. http://htmlparser.org");
    Filter.newline(paramStringBuffer);
    Filter.spaces(paramStringBuffer, arrayOfInt[0]);
    paramStringBuffer.append("// ");
    try
    {
      paramStringBuffer.append(Filter.deconstitute(arrayOfFilter));
      Filter.newline(paramStringBuffer);
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("import org.htmlparser.*;");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("import org.htmlparser.filters.*;");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("import org.htmlparser.beans.*;");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("import org.htmlparser.util.*;");
      Filter.newline(paramStringBuffer);
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("public class ");
      paramStringBuffer.append(paramString);
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("{");
      arrayOfInt[0] = 4;
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("public static void main (String args[])");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("{");
      Filter.newline(paramStringBuffer);
      arrayOfInt[0] = 8;
      arrayOfString = new String[arrayOfFilter.length];
      int i = 0;
      if (i < arrayOfString.length)
      {
        arrayOfString[i] = arrayOfFilter[i].toJavaCode(paramStringBuffer, arrayOfInt);
        ++i;
      }
    }
    catch (IOException localIOException)
    {
      while (true)
        localIOException.printStackTrace();
      StringBuffer localStringBuffer = new StringBuffer().append("array");
      int j = arrayOfInt[2];
      arrayOfInt[2] = (j + 1);
      String str = j;
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("NodeFilter[] ");
      paramStringBuffer.append(str);
      paramStringBuffer.append(" = new NodeFilter[");
      paramStringBuffer.append(arrayOfFilter.length);
      paramStringBuffer.append("];");
      Filter.newline(paramStringBuffer);
      for (int k = 0; k < arrayOfFilter.length; ++k)
      {
        Filter.spaces(paramStringBuffer, arrayOfInt[0]);
        paramStringBuffer.append(str);
        paramStringBuffer.append("[");
        paramStringBuffer.append(k);
        paramStringBuffer.append("] = ");
        paramStringBuffer.append(arrayOfString[k]);
        paramStringBuffer.append(";");
        Filter.newline(paramStringBuffer);
      }
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("FilterBean bean = new FilterBean ();");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("bean.setFilters (");
      paramStringBuffer.append(str);
      paramStringBuffer.append(");");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("if (0 != args.length)");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("{");
      Filter.newline(paramStringBuffer);
      arrayOfInt[0] = 12;
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("bean.setURL (args[0]);");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("System.out.println (bean.getNodes ().toHtml ());");
      Filter.newline(paramStringBuffer);
      arrayOfInt[0] = 8;
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("}");
      Filter.newline(paramStringBuffer);
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("else");
      Filter.newline(paramStringBuffer);
      arrayOfInt[0] = 12;
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("System.out.println (\"Usage: java -classpath .:htmlparser.jar ");
      paramStringBuffer.append(paramString);
      paramStringBuffer.append(" <url>\");");
      Filter.newline(paramStringBuffer);
      arrayOfInt[0] = 4;
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("}");
      Filter.newline(paramStringBuffer);
      arrayOfInt[0] = 0;
      Filter.spaces(paramStringBuffer, arrayOfInt[0]);
      paramStringBuffer.append("}");
      Filter.newline(paramStringBuffer);
    }
  }

  public void mouseClicked(MouseEvent paramMouseEvent)
  {
    Filter localFilter1;
    int i;
    boolean bool;
    Filter[] arrayOfFilter;
    Filter localFilter2;
    Object localObject = paramMouseEvent.getSource();
    if (localObject instanceof Filter)
    {
      localFilter1 = (Filter)localObject;
      i = paramMouseEvent.getModifiers();
      bool = selectionContains(localFilter1);
      if ((i & 0x1) != 0)
      {
        SubFilterList localSubFilterList = getEnclosed(localFilter1);
        if (localSubFilterList != null)
        {
          arrayOfFilter = localSubFilterList.getFilters();
          localFilter2 = lastSelected();
          if (localFilter2 != null)
            break label82;
          addSelection(localFilter1);
        }
      }
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              label82: int j;
              int k;
              do
              {
                while (true)
                {
                  return;
                  arrayOfFilter = getFilters();
                }
                j = -1;
                k = -1;
                for (int l = 0; l < arrayOfFilter.length; ++l)
                {
                  if (arrayOfFilter[l] == localFilter1)
                    j = l;
                  if (arrayOfFilter[l] == localFilter2)
                    k = l;
                }
              }
              while ((j == -1) || (k == -1));
              int i1 = Math.min(j, k);
              while (true)
              {
                if (i1 > Math.max(j, k));
                addSelection(arrayOfFilter[i1]);
                ++i1;
              }
              if ((i & 0x2) == 0)
                break label212;
              if (!(bool))
                break;
              removeSelection(localFilter1);
            }
            addSelection(localFilter1);
          }
          label212: if ((i & 0x4) == 0)
            break;
          if (!(selectionContains(localFilter1)))
          {
            clearSelection();
            addSelection(localFilter1);
          }
          showContextMenu(paramMouseEvent);
        }
        clearSelection();
        addSelection(localFilter1);
      }
      clearSelection();
    }
  }

  /**
   * @deprecated
   */
  public void mouseDragged(MouseEvent paramMouseEvent)
  {
    Filter localFilter;
    monitorenter;
    try
    {
      Object localObject2 = paramMouseEvent.getSource();
      if (localObject2 instanceof Filter)
      {
        SubFilterList localSubFilterList;
        localFilter = (Filter)localObject2;
        if (!(selectionContains(localFilter)))
          break label127;
        label127: if (localSubFilterList == null);
      }
    }
    finally
    {
      try
      {
        Point localPoint1 = getBasePoint();
        if (localPoint1 != null)
        {
          Point localPoint2 = paramMouseEvent.getPoint();
          Point localPoint3 = localFilter.getLocation();
          localPoint2.translate(localPoint3.x, localPoint3.y);
          Point localPoint4 = new Point(localPoint2.x - localPoint1.x, localPoint2.y - localPoint1.y);
          setBasePoint(localPoint2);
          moveSelection(localPoint4);
        }
        while (true)
        {
          monitorexit;
          return;
          mouseClicked(paramMouseEvent);
        }
        localObject1 = finally;
        monitorexit;
        throw localObject1;
      }
      catch (Exception localException)
      {
      }
    }
  }

  public void mouseEntered(MouseEvent paramMouseEvent)
  {
  }

  public void mouseExited(MouseEvent paramMouseEvent)
  {
  }

  public void mouseMoved(MouseEvent paramMouseEvent)
  {
  }

  public void mousePressed(MouseEvent paramMouseEvent)
  {
    Object localObject = paramMouseEvent.getSource();
    if (localObject instanceof Filter)
    {
      Point localPoint1 = paramMouseEvent.getPoint();
      Point localPoint2 = ((Component)localObject).getLocation();
      localPoint1.translate(localPoint2.x, localPoint2.y);
      setBasePoint(localPoint1);
    }
    while (true)
    {
      return;
      setBasePoint(null);
    }
  }

  public void mouseReleased(MouseEvent paramMouseEvent)
  {
  }

  // ERROR //
  protected void moveSelection(Point paramPoint)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 452	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mSelection	Ljava/util/Vector;
    //   4: invokevirtual 936	java/util/Vector:size	()I
    //   7: istore_2
    //   8: iconst_0
    //   9: istore_3
    //   10: iload_3
    //   11: iload_2
    //   12: if_icmpge +78 -> 90
    //   15: aload_0
    //   16: getfield 452	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mSelection	Ljava/util/Vector;
    //   19: iload_3
    //   20: invokevirtual 1163	java/util/Vector:elementAt	(I)Ljava/lang/Object;
    //   23: checkcast 532	org/htmlparser/parserapplications/filterbuilder/Filter
    //   26: astore 4
    //   28: aload 4
    //   30: invokevirtual 1139	org/htmlparser/parserapplications/filterbuilder/Filter:getLocation	()Ljava/awt/Point;
    //   33: astore 5
    //   35: aload 5
    //   37: aload_1
    //   38: getfield 1142	java/awt/Point:x	I
    //   41: aload_1
    //   42: getfield 965	java/awt/Point:y	I
    //   45: invokevirtual 1145	java/awt/Point:translate	(II)V
    //   48: aload 4
    //   50: invokevirtual 1166	org/htmlparser/parserapplications/filterbuilder/Filter:getTreeLock	()Ljava/lang/Object;
    //   53: astore 6
    //   55: aload 6
    //   57: monitorenter
    //   58: aload 4
    //   60: aload 5
    //   62: getfield 1142	java/awt/Point:x	I
    //   65: aload 5
    //   67: getfield 965	java/awt/Point:y	I
    //   70: invokevirtual 1168	org/htmlparser/parserapplications/filterbuilder/Filter:setLocation	(II)V
    //   73: aload 6
    //   75: monitorexit
    //   76: iinc 3 1
    //   79: goto -69 -> 10
    //   82: astore 7
    //   84: aload 6
    //   86: monitorexit
    //   87: aload 7
    //   89: athrow
    //   90: aload_0
    //   91: iconst_1
    //   92: putfield 587	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mMoved	Z
    //   95: return
    //
    // Exception table:
    //   from	to	target	type
    //   58	87	82	finally
  }

  protected void newAction()
  {
    this.mMainPanel.removeAll();
    this.mSelection.clear();
    relayout();
  }

  // ERROR //
  public void open(String paramString)
  {
    // Byte code:
    //   0: new 1173	java/io/LineNumberReader
    //   3: dup
    //   4: new 1175	java/io/FileReader
    //   7: dup
    //   8: aload_1
    //   9: invokespecial 1176	java/io/FileReader:<init>	(Ljava/lang/String;)V
    //   12: invokespecial 1179	java/io/LineNumberReader:<init>	(Ljava/io/Reader;)V
    //   15: astore_2
    //   16: aload_2
    //   17: invokevirtual 1182	java/io/LineNumberReader:readLine	()Ljava/lang/String;
    //   20: astore 4
    //   22: aload 4
    //   24: ifnull +141 -> 165
    //   27: aload 4
    //   29: ldc_w 1184
    //   32: invokevirtual 1188	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   35: ifeq -19 -> 16
    //   38: aload 4
    //   40: iconst_3
    //   41: invokevirtual 558	java/lang/String:substring	(I)Ljava/lang/String;
    //   44: astore 5
    //   46: aload 5
    //   48: new 751	org/htmlparser/Parser
    //   51: dup
    //   52: aload_0
    //   53: getfield 359	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mURLField	Ljavax/swing/JTextField;
    //   56: invokevirtual 754	javax/swing/JTextField:getText	()Ljava/lang/String;
    //   59: invokespecial 755	org/htmlparser/Parser:<init>	(Ljava/lang/String;)V
    //   62: invokestatic 759	org/htmlparser/parserapplications/filterbuilder/Filter:reconstitute	(Ljava/lang/String;Lorg/htmlparser/Parser;)[Lorg/htmlparser/parserapplications/filterbuilder/Filter;
    //   65: astore 7
    //   67: aload_0
    //   68: getfield 127	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mMainPanel	Ljavax/swing/JPanel;
    //   71: invokevirtual 1170	javax/swing/JPanel:removeAll	()V
    //   74: new 916	java/awt/Point
    //   77: dup
    //   78: invokespecial 1189	java/awt/Point:<init>	()V
    //   81: astore 8
    //   83: iconst_0
    //   84: istore 9
    //   86: iload 9
    //   88: aload 7
    //   90: arraylength
    //   91: if_icmpge +58 -> 149
    //   94: aload 7
    //   96: iload 9
    //   98: aaload
    //   99: invokevirtual 962	org/htmlparser/parserapplications/filterbuilder/Filter:getPreferredSize	()Ljava/awt/Dimension;
    //   102: astore 10
    //   104: aload_0
    //   105: getfield 127	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mMainPanel	Ljavax/swing/JPanel;
    //   108: aload 7
    //   110: iload 9
    //   112: aaload
    //   113: invokevirtual 337	javax/swing/JPanel:add	(Ljava/awt/Component;)Ljava/awt/Component;
    //   116: pop
    //   117: aload 7
    //   119: iload 9
    //   121: aaload
    //   122: aload 8
    //   124: invokevirtual 959	org/htmlparser/parserapplications/filterbuilder/Filter:setLocation	(Ljava/awt/Point;)V
    //   127: aload 8
    //   129: aload 8
    //   131: getfield 965	java/awt/Point:y	I
    //   134: aload 10
    //   136: getfield 821	java/awt/Dimension:height	I
    //   139: iadd
    //   140: putfield 965	java/awt/Point:y	I
    //   143: iinc 9 1
    //   146: goto -60 -> 86
    //   149: aload_0
    //   150: aload 7
    //   152: invokevirtual 974	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:setupMouseListeners	([Lorg/htmlparser/parserapplications/filterbuilder/Filter;)V
    //   155: aload_0
    //   156: aload 7
    //   158: invokevirtual 971	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:setupDropTargets	([Lorg/htmlparser/parserapplications/filterbuilder/Filter;)V
    //   161: aload_0
    //   162: invokevirtual 640	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:relayout	()V
    //   165: aload_2
    //   166: invokevirtual 1192	java/io/LineNumberReader:close	()V
    //   169: goto +18 -> 187
    //   172: astore 6
    //   174: aload 6
    //   176: invokevirtual 904	org/htmlparser/util/ParserException:printStackTrace	()V
    //   179: goto -14 -> 165
    //   182: astore_3
    //   183: aload_3
    //   184: invokevirtual 767	java/io/IOException:printStackTrace	()V
    //   187: return
    //
    // Exception table:
    //   from	to	target	type
    //   46	165	172	org/htmlparser/util/ParserException
    //   0	46	182	java/io/IOException
    //   46	165	182	java/io/IOException
    //   165	179	182	java/io/IOException
  }

  protected void openAction()
  {
    FileDialog localFileDialog = new FileDialog(this);
    localFileDialog.setMode(0);
    localFileDialog.setTitle("Open");
    localFileDialog.setDirectory(mHomeDir);
    localFileDialog.setVisible(true);
    if (localFileDialog.getFile() != null)
    {
      mHomeDir = localFileDialog.getDirectory();
      File localFile = new File(mHomeDir + localFileDialog.getFile());
      open(localFile.getAbsolutePath());
      setTitle("HTML Parser FilterBuilder - " + localFile.getAbsolutePath());
    }
  }

  protected void pasteAction()
  {
    Transferable localTransferable = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(this);
    if (localTransferable.isDataFlavorSupported(DataFlavor.stringFlavor));
    try
    {
      Filter[] arrayOfFilter = Filter.reconstitute((String)localTransferable.getTransferData(DataFlavor.stringFlavor), new Parser(this.mURLField.getText()));
      if (isSingleSelection())
      {
        SubFilterList localSubFilterList = getEnclosed(getSelection()[0]);
        if (localSubFilterList != null)
        {
          int j = 0;
          while (true)
          {
            if (j >= arrayOfFilter.length)
              break label171;
            localSubFilterList.addFilter(arrayOfFilter[j]);
            ++j;
          }
        }
      }
      Point localPoint = new Point(0, 0);
      for (int i = 0; i < arrayOfFilter.length; ++i)
      {
        arrayOfFilter[i].setLocation(localPoint);
        this.mMainPanel.add(arrayOfFilter[i]);
        localPoint.y += arrayOfFilter[i].getPreferredSize().height;
      }
      label171: setupMouseListeners(arrayOfFilter);
      setupDropTargets(arrayOfFilter);
      relayout();
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public void relayout()
  {
    this.mMainPanel.invalidate();
    this.mMainScroller.invalidate();
    this.mMainScroller.validate();
    this.mMainScroller.repaint();
  }

  protected void removeSelection(Filter paramFilter)
  {
    this.mSelection.removeElement(paramFilter);
    paramFilter.setSelected(false);
  }

  // ERROR //
  public void save(String paramString)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 786	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:getFilters	()[Lorg/htmlparser/parserapplications/filterbuilder/Filter;
    //   4: astore_2
    //   5: aload_2
    //   6: arraylength
    //   7: ifeq +109 -> 116
    //   10: new 788	org/htmlparser/beans/FilterBean
    //   13: dup
    //   14: invokespecial 789	org/htmlparser/beans/FilterBean:<init>	()V
    //   17: astore_3
    //   18: aload_3
    //   19: aload_0
    //   20: getfield 359	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mURLField	Ljavax/swing/JTextField;
    //   23: invokevirtual 754	javax/swing/JTextField:getText	()Ljava/lang/String;
    //   26: invokevirtual 792	org/htmlparser/beans/FilterBean:setURL	(Ljava/lang/String;)V
    //   29: aload_3
    //   30: aload_2
    //   31: invokevirtual 796	org/htmlparser/beans/FilterBean:setFilters	([Lorg/htmlparser/NodeFilter;)V
    //   34: new 77	java/lang/StringBuffer
    //   37: dup
    //   38: invokespecial 80	java/lang/StringBuffer:<init>	()V
    //   41: astore 4
    //   43: aload_0
    //   44: aload_0
    //   45: aload_1
    //   46: invokevirtual 1238	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:classFromFile	(Ljava/lang/String;)Ljava/lang/String;
    //   49: aload 4
    //   51: aload_3
    //   52: invokevirtual 1240	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:makeProgram	(Ljava/lang/String;Ljava/lang/StringBuffer;Lorg/htmlparser/beans/FilterBean;)V
    //   55: new 1242	java/io/PrintWriter
    //   58: dup
    //   59: new 1244	java/io/FileWriter
    //   62: dup
    //   63: aload_1
    //   64: invokespecial 1245	java/io/FileWriter:<init>	(Ljava/lang/String;)V
    //   67: iconst_1
    //   68: invokespecial 1248	java/io/PrintWriter:<init>	(Ljava/io/Writer;Z)V
    //   71: astore 5
    //   73: aload 5
    //   75: aload 4
    //   77: invokevirtual 92	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   80: invokevirtual 1251	java/io/PrintWriter:write	(Ljava/lang/String;)V
    //   83: aload 5
    //   85: invokevirtual 1254	java/io/PrintWriter:flush	()V
    //   88: aload 5
    //   90: invokevirtual 1255	java/io/PrintWriter:close	()V
    //   93: goto +63 -> 156
    //   96: astore 6
    //   98: aload 5
    //   100: invokevirtual 1255	java/io/PrintWriter:close	()V
    //   103: aload 6
    //   105: athrow
    //   106: astore 7
    //   108: aload 7
    //   110: invokevirtual 767	java/io/IOException:printStackTrace	()V
    //   113: goto +43 -> 156
    //   116: aload_0
    //   117: getfield 127	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:mMainPanel	Ljavax/swing/JPanel;
    //   120: astore 8
    //   122: iconst_1
    //   123: anewarray 65	java/lang/String
    //   126: astore 9
    //   128: aload 9
    //   130: iconst_0
    //   131: ldc_w 1257
    //   134: aastore
    //   135: aload 8
    //   137: ldc_w 1259
    //   140: ldc_w 1261
    //   143: bipush 255
    //   145: iconst_0
    //   146: aconst_null
    //   147: aload 9
    //   149: ldc_w 1257
    //   152: invokestatic 476	javax/swing/JOptionPane:showOptionDialog	(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;IILjavax/swing/Icon;[Ljava/lang/Object;Ljava/lang/Object;)I
    //   155: pop
    //   156: return
    //
    // Exception table:
    //   from	to	target	type
    //   73	88	96	finally
    //   55	73	106	java/io/IOException
    //   88	106	106	java/io/IOException
  }

  protected void saveAction()
  {
    File localFile;
    String str = getTitle();
    int i = str.indexOf(" - ");
    if (-1 != i)
      localFile = new File(str.substring(i + 3));
    while (true)
    {
      while (true)
      {
        if (localFile != null)
          save(localFile.getAbsolutePath());
        return;
        FileDialog localFileDialog = new FileDialog(this);
        localFileDialog.setMode(1);
        localFileDialog.setTitle("Save");
        localFileDialog.setDirectory(mHomeDir);
        localFileDialog.setVisible(true);
        if (localFileDialog.getFile() == null)
          break;
        mHomeDir = localFileDialog.getDirectory();
        localFile = new File(mHomeDir + localFileDialog.getFile());
        setTitle("HTML Parser FilterBuilder - " + localFile.getAbsolutePath());
      }
      localFile = null;
    }
  }

  protected void saveasAction()
  {
    setTitle("HTML Parser FilterBuilder");
    saveAction();
  }

  protected void selectSelection(boolean paramBoolean)
  {
    int i = this.mSelection.size();
    for (int j = 0; j < i; ++j)
      ((Filter)this.mSelection.elementAt(j)).setSelected(paramBoolean);
  }

  protected boolean selectionContains(Filter paramFilter)
  {
    return this.mSelection.contains(paramFilter);
  }

  // ERROR //
  public String serializeSelection()
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 612	org/htmlparser/parserapplications/filterbuilder/FilterBuilder:getSelection	()[Lorg/htmlparser/parserapplications/filterbuilder/Filter;
    //   4: astore_1
    //   5: new 1277	java/io/StringWriter
    //   8: dup
    //   9: sipush 200
    //   12: invokespecial 1278	java/io/StringWriter:<init>	(I)V
    //   15: astore_2
    //   16: new 1242	java/io/PrintWriter
    //   19: dup
    //   20: aload_2
    //   21: iconst_0
    //   22: invokespecial 1248	java/io/PrintWriter:<init>	(Ljava/io/Writer;Z)V
    //   25: astore_3
    //   26: aload_3
    //   27: aload_1
    //   28: invokestatic 704	org/htmlparser/parserapplications/filterbuilder/Filter:deconstitute	([Lorg/htmlparser/parserapplications/filterbuilder/Filter;)Ljava/lang/String;
    //   31: invokevirtual 1279	java/io/PrintWriter:println	(Ljava/lang/String;)V
    //   34: aload_3
    //   35: invokevirtual 1255	java/io/PrintWriter:close	()V
    //   38: aload_2
    //   39: invokevirtual 1283	java/io/StringWriter:getBuffer	()Ljava/lang/StringBuffer;
    //   42: invokevirtual 92	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   45: areturn
    //   46: astore 5
    //   48: aload 5
    //   50: invokevirtual 767	java/io/IOException:printStackTrace	()V
    //   53: aload_3
    //   54: invokevirtual 1255	java/io/PrintWriter:close	()V
    //   57: goto -19 -> 38
    //   60: astore 4
    //   62: aload_3
    //   63: invokevirtual 1255	java/io/PrintWriter:close	()V
    //   66: aload 4
    //   68: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   26	34	46	java/io/IOException
    //   26	34	60	finally
    //   48	53	60	finally
  }

  protected void setBasePoint(Point paramPoint)
  {
    this.mBasePoint = paramPoint;
  }

  public void setExpanded(Filter[] paramArrayOfFilter, boolean paramBoolean1, boolean paramBoolean2)
  {
    for (int i = 0; i < paramArrayOfFilter.length; ++i)
    {
      if (paramBoolean2)
      {
        SubFilterList localSubFilterList = getEnclosed(paramArrayOfFilter[i]);
        if (localSubFilterList != null)
          setExpanded(localSubFilterList.getFilters(), paramBoolean1, paramBoolean2);
      }
      paramArrayOfFilter[i].setExpanded(paramBoolean1);
    }
  }

  public void setupDropTargets(Filter[] paramArrayOfFilter)
  {
    for (int i = 0; i < paramArrayOfFilter.length; ++i)
    {
      SubFilterList localSubFilterList = getEnclosed(paramArrayOfFilter[i]);
      if (localSubFilterList != null)
      {
        Component[] arrayOfComponent = localSubFilterList.getDropTargets();
        for (int j = 0; j < arrayOfComponent.length; ++j)
          new DropTarget(arrayOfComponent[j], this);
        setupDropTargets(localSubFilterList.getFilters());
      }
    }
  }

  public void setupMouseListeners(Filter[] paramArrayOfFilter)
  {
    for (int i = 0; i < paramArrayOfFilter.length; ++i)
    {
      paramArrayOfFilter[i].addMouseListener(this);
      paramArrayOfFilter[i].addMouseMotionListener(this);
      SubFilterList localSubFilterList = getEnclosed(paramArrayOfFilter[i]);
      if (localSubFilterList != null)
        setupMouseListeners(localSubFilterList.getFilters());
    }
  }

  public void showContextMenu(MouseEvent paramMouseEvent)
  {
    JPopupMenu localJPopupMenu = new JPopupMenu();
    localJPopupMenu.setName("Popup");
    JMenuItem localJMenuItem1 = new JMenuItem("Expand");
    localJMenuItem1.setActionCommand("expandAction");
    localJMenuItem1.addActionListener(this);
    localJPopupMenu.add(localJMenuItem1);
    JMenuItem localJMenuItem2 = new JMenuItem("Collapse");
    localJMenuItem2.setActionCommand("collapseAction");
    localJMenuItem2.addActionListener(this);
    localJPopupMenu.add(localJMenuItem2);
    localJPopupMenu.addSeparator();
    JMenuItem localJMenuItem3 = new JMenuItem("Expand All");
    localJMenuItem3.setActionCommand("expandAllAction");
    localJMenuItem3.addActionListener(this);
    localJPopupMenu.add(localJMenuItem3);
    JMenuItem localJMenuItem4 = new JMenuItem("CollapseAll");
    localJMenuItem4.setActionCommand("collapseAllAction");
    localJMenuItem4.addActionListener(this);
    localJPopupMenu.add(localJMenuItem4);
    localJPopupMenu.addSeparator();
    JMenuItem localJMenuItem5 = new JMenuItem("Cut");
    localJMenuItem5.setActionCommand("cutAction");
    localJMenuItem5.addActionListener(this);
    localJPopupMenu.add(localJMenuItem5);
    JMenuItem localJMenuItem6 = new JMenuItem("Copy");
    localJMenuItem6.setActionCommand("copyAction");
    localJMenuItem6.addActionListener(this);
    localJPopupMenu.add(localJMenuItem6);
    JMenuItem localJMenuItem7 = new JMenuItem("Paste");
    localJMenuItem7.setActionCommand("pasteAction");
    localJMenuItem7.addActionListener(this);
    localJPopupMenu.add(localJMenuItem7);
    JMenuItem localJMenuItem8 = new JMenuItem("Delete");
    localJMenuItem8.setActionCommand("deleteAction");
    localJMenuItem8.addActionListener(this);
    localJPopupMenu.add(localJMenuItem8);
    localJPopupMenu.addSeparator();
    JMenuItem localJMenuItem9 = new JMenuItem("Execute Filter");
    localJMenuItem9.setActionCommand("executeAction");
    localJMenuItem9.addActionListener(this);
    localJPopupMenu.add(localJMenuItem9);
    localJPopupMenu.show(paramMouseEvent.getComponent(), paramMouseEvent.getX(), paramMouseEvent.getY());
  }

  protected void tutorialAction()
  {
    JPanel localJPanel = this.mMainPanel;
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "Close";
    JOptionPane.showOptionDialog(localJPanel, "<html>To get the title text from a page:<br><ul><li>Choose 'New' from the File menu.</li><li>Choose 'AndFilter' from the Filter menu.</li><li>Select the And filter so it is highlighted.</li><li>Choose 'HasParent' from the Filter menu.</li><li>Toggle the 'Recursive' checkbox on in the HasParent filter.</li><li>Select the HasParent filter so it is highlighted.</li><li>Choose 'TagName' from the Filter menu.<br><i>Alternatively, you can drag the TagName filter (icon Hello-BOB)<br>from the toolbar and drop inside the HasParent filter</i></li><li>Choose 'TITLE' from the TagName combo-box.</li><li>Select the And filter and choose 'Execute Filter' from the<br>Operations menu to test it.</li><li>If there is unwanted non-text nodes in the result<br>select the And filter and choose 'RegexFilter' from the Filter menu.</li><li>Test it again, as above.</li><li>Choose 'Save' from the File menu and enter a filename like GetTitle.java</li><li>Compile the java file and run it.</li></ul></html>", "FilterBuilder Tutorial", -1, 1, null, arrayOfString, "Close");
  }

  public void windowActivated(WindowEvent paramWindowEvent)
  {
  }

  public void windowClosed(WindowEvent paramWindowEvent)
  {
  }

  public void windowClosing(WindowEvent paramWindowEvent)
  {
    if (paramWindowEvent.getSource() == this)
      exitApplication();
  }

  public void windowDeactivated(WindowEvent paramWindowEvent)
  {
  }

  public void windowDeiconified(WindowEvent paramWindowEvent)
  {
  }

  public void windowIconified(WindowEvent paramWindowEvent)
  {
  }

  public void windowOpened(WindowEvent paramWindowEvent)
  {
  }
}